<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tk="http://www.qdocuments.net" exclude-result-prefixes="tk">
  <xsl:import href="PageListItems_Trans.xslt"/>
  <xsl:import href="Button.xslt"/>
  <xsl:variable name="tk:Sort" select="$tk:Toolkit/Sort"/>
  <xsl:variable name="tk:CurPage" select="$tk:Toolkit/Page/CurrentPage"/>
  <xsl:variable name="tk:RealOrder">
    <xsl:choose>
      <xsl:when test="$tk:Sort/Order='DESC'">ASC</xsl:when>
      <xsl:otherwise>DESC</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="tk:ListHeadUrl" select="concat($tk:DSelfURL, 'cChar=', $tk:Sort/CChar,'&amp;ID=', $tk:Sort/ID)"/>
  <xsl:variable name="tk:ListOrder" select="concat('&amp;Sort=', $tk:Sort/SortField, '&amp;Order=', $tk:RealOrder)"/>
  <xsl:template name="tk:ColHead">
    <xsl:param name="Title"/>
    <th>
      <xsl:if test="tk:Display/@ListWidth">
        <xsl:attribute name="width"><xsl:value-of select="tk:Display/@ListWidth"/></xsl:attribute>
      </xsl:if>
      <a style="text-decoration:none" href="{concat($tk:ListHeadUrl, '&amp;Page=', $tk:CurPage, '&amp;Sort=', position(), '&amp;Order=ASC')}">
        <xsl:value-of select="$Title"/>
      </a>
    </th>
  </xsl:template>
  <xsl:template match="NewPage">
    <xsl:choose>
      <xsl:when test="Item =$tk:CurPage ">
        <font color="red">
          <b>
            <xsl:value-of select="Item"/>
          </b>
        </font>
      </xsl:when>
      <xsl:otherwise>
        <a href="{concat($tk:ListHeadUrl, '&amp;Page=', Item, $tk:ListOrder)}">
          <xsl:value-of select="Item"/>
        </a>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:call-template name="tk:WhiteSpace"/>
  </xsl:template>
  <xsl:template match="tk:Module[tk:DataSet='List' or tk:DataSet='ListXml' or tk:DataSet='ListDetail' or tk:DataSet='ListDetailXml']" mode="tk:Button">
    <table border="0">
      <tr>
        <td valign="top">
          <xsl:call-template name="tk:ExcelButton"/>
        </td>
      </tr>
    </table>
  </xsl:template>
</xsl:stylesheet>
